<template>
  <div>
    <div class="labelBox" v-for="(item, index) in wayCollect" :key="index">
      <Label :way="item"></Label>
    </div>
  </div>
</template>

<script setup lang="ts">
import Label from "@/components/label.vue";
import { ref, onMounted } from "vue";
import axios from "@/http";
let wayCollect = ref<Array<string>>([]);
onMounted(() => {
  getBlogWay();
});
const getBlogWay = () => {
  axios.get("/blog/waylist").then((res) => {
    res.data.error === -1 &&
      (wayCollect.value = [{ way: "全部" }, ...res.data.data].map(
        (item: { way: string }) => item.way
      ));
  });
};
</script>

<style lang="scss" scoped>
.labelBox {
  height: 40px;
}
</style>
